/*
20
200
 */
#include <iostream>
using namespace std;

class Integer{
	private:
		int m_i;
	public:
		Integer(int i = 0): m_i(i){}
		const bool operator>(const Integer& that) const{
			return m_i > that.m_i;
		}
		friend ostream& operator<<(ostream& os, const Integer& that){
			os << that.m_i << endl;
			return os;
		}
};

template<typename T>
T Max(T t1, T t2){
	return t1 > t2 ? t1 : t2;
}

int main(){
	int a1 = 10;
	int a2 = 20;
	cout << Max(a1, a2) << endl;

	Integer b1(100);
	Integer b2(200);
	//Max 函数返回的是一个临时对象（右值），故operator<<操作符重载函数中Integer&要加const修饰，否则编译出错
	cout << Max(b1, b2);
	return 0;
}
